<script setup>
import { articleGetCategoryService } from '@/api/article.js'
import { ref, defineProps, toRefs } from 'vue'
const catgoryList = ref()
const getCatgory = async () => {
  const {
    data: { data }
  } = await articleGetCategoryService()
  catgoryList.value = data
}
getCatgory()

// const prop = defineProps(['modelValue'])
const prop = defineProps({
  modelValue: String
})
const { modelValue } = toRefs(prop)
const emit = defineEmits(['update:modelValue'])
</script>
<template>
  <el-select
    style="width: 200px"
    :modelValue="modelValue"
    @update:modelValue="
      emit('update:modelValue', $event)
    "
  >
    <el-option
      v-for="item in catgoryList"
      :key="item.id"
      :label="item.cate_name"
      :value="item.id"
    ></el-option>
  </el-select>
</template>
